package com.cndw.kungfu.config;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class ArtifactConfig {

	public static final int actUpGoldBase = 9;

	public static final int actUpMax = 200;

	public static final int[] actUpRate = { 100, 90, 80, 70, 60, 50, 40, 40, 30, 30 };
	
	/**
	 * 加属性点的道具
	 */
	public static final int nodeForgeGoodsId = 103523;
	
	/**
	 * 定向洗练的消耗
	 */
	public static final int nodeForgeSingleGold = 200;
	/**
	 * 道具增加兵魄的点数
	 */
	public static final int[] nodeForgeGoodsAdd = {0,2,2,2,2,3,3,5,5,2,0};
	
	/**
	 * 兵魄升级需要的金币
	 */
	public static final int[] nodeUpGold = { 100, 500, 2000, 5000 };

	public static final int[] nodeGirdGold = { 20, 20, 50 };
	/**
	 * 打碎获得的碎魄
	 */
	public static final int[] meltNum = { 1, 5, 20, 50, 200 };
	/**
	 * 银两洗炼基础银两
	 */
	public static final int forgeAssetBase = 2000;
	/**
	 * 合成
	 */
	public static final int[] nodeExchange = { 100, 10, 50, 200, 500 };

	private static Map<Integer, int[]> idAtts = new HashMap<Integer, int[]>();

	private static int[][] rateIds = { { 1, 0 }, { 2, 0 }, { 3, 0 }, { 4, 0 }, { 5, 0 }, { 6, 0 }, { 7, 0 }, { 8, 0 }, { 9, 0 }, { 1, 1 }, { 2, 1 }, { 3, 1 },
			{ 4, 1 }, { 5, 1 }, { 6, 1 }, { 7, 1 }, { 8, 1 }, { 9, 1 }, { 1, 2 }, { 2, 2 }, { 3, 2 }, { 4, 2 }, { 5, 2 }, { 6, 2 }, { 7, 2 }, { 8, 2 },
			{ 9, 2 }, { 1, 3 }, { 2, 3 }, { 3, 3 }, { 4, 3 }, { 5, 3 }, { 6, 3 }, { 7, 3 }, { 8, 3 }, { 9, 3 }, { 1, 4 }, { 2, 4 }, { 3, 4 }, { 4, 4 },
			{ 5, 4 }, { 6, 4 }, { 7, 4 }, { 8, 4 }, { 9, 4 } };

	private static Map<Integer, int[]> rates = new HashMap<Integer, int[]>();

	static {
		idAtts.put(1, new int[] { 24, 480, 960, 1440, 1920, 2400 });

		idAtts.put(2, new int[] { 24, 480, 960, 1440, 1920, 2400 });

		idAtts.put(3, new int[] { 24, 480, 960, 1440, 1920, 2400 });

		idAtts.put(4, new int[] { 24, 480, 960, 1440, 1920, 2400 });

		idAtts.put(5, new int[] { 72, 1440, 2880, 4320, 5760, 7200 });

		idAtts.put(6, new int[] { 72, 1440, 2880, 4320, 5760, 7200 });

		idAtts.put(7, new int[] { 120, 2400, 4800, 7200, 9600, 12000 });

		idAtts.put(8, new int[] { 120, 2400, 4800, 7200, 9600, 12000 });

		idAtts.put(9, new int[] { 24, 480, 960, 1440, 1920, 2400 });

		rates.put(0, new int[] { 400, 400, 400, 2000, 400, 2500, 1000, 2500, 400 });
		rates.put(1, new int[] { 300, 300, 300, 1500, 300, 1875, 750, 1875, 300, 100, 100, 100, 500, 100, 625, 250, 625, 100 });
		rates.put(2, new int[] { 200, 200, 200, 800, 200, 1000, 425, 1000, 200, 200, 200, 200, 800, 200, 1000, 455, 1000, 200, 80, 80, 80, 280, 80, 345, 150,
				345, 80 });
		rates.put(3, new int[] { 180, 180, 180, 780, 180, 980, 405, 980, 180, 180, 180, 180, 780, 180, 980, 435, 980, 180, 60, 60, 60, 260, 60, 325, 130, 325,
				60, 30, 30, 30, 100, 30, 120, 50, 120, 30 });
		rates.put(4, new int[] { 130, 130, 130, 530, 130, 610, 280, 610, 130, 120, 120, 120, 520, 120, 610, 280, 610, 120, 120, 120, 120, 520, 120, 600, 290,
				600, 120, 40, 40, 40, 150, 40, 220, 850, 220, 40, 20, 20, 20, 90, 20, 110, 40, 110, 20 });
	}

	public static int[] getRate(int quality) {
		return rates.get(quality);
	}

	public static int[] getId(int indexId) {
		return rateIds[indexId];
	}

	public static int[] getAttri(int id) {
		return idAtts.get(id);
	}

	public static Map<Integer, int[]> fourNodeBuff = new HashMap<Integer, int[]>();
	@Deprecated
	public static int[][] fourNodes = {{},{4,5,6,7},{1,3,4,6}};
	
	private static Map<Integer, Set<Integer>> fourNodsMap = new HashMap<Integer, Set<Integer>>();

	static {
		
		fourNodsMap.put(1, new HashSet<Integer>());
		fourNodsMap.put(2, new HashSet<Integer>());
		fourNodsMap.get(1).add(4);
		fourNodsMap.get(1).add(5);
		fourNodsMap.get(1).add(6);
		fourNodsMap.get(1).add(7);
			
		fourNodsMap.get(2).add(1);
		fourNodsMap.get(2).add(3);
		fourNodsMap.get(2).add(4);
		fourNodsMap.get(2).add(6);
		
		
		fourNodeBuff.put(7, new int[] { 0, 0, 0, 7200, 10800, 18000, 36000 });//血
		fourNodeBuff.put(5, new int[] { 0, 0, 0, 4200, 6300, 10500, 21000 });//攻
		fourNodeBuff.put(6, new int[] { 0, 0, 0, 4200, 6300, 10500, 21000 });//防
		fourNodeBuff.put(4, new int[] { 0, 0, 0, 1440, 2160, 3600, 7200 });//任性
		
		
		fourNodeBuff.put(6, new int[] { 0, 0, 0, 4200, 6300, 10500, 21000 });//防御
		fourNodeBuff.put(4, new int[] { 0, 0, 0, 1440, 2160, 3600, 7200 });//任性
		fourNodeBuff.put(1, new int[] { 0, 0, 0, 1440, 2160, 3600, 7200 });//命中
		fourNodeBuff.put(3, new int[] { 0, 0, 0, 1440, 2160, 3600, 7200 });//暴击
		
		
	}
	
	public static boolean isAct(int actId,int pId){
		return fourNodsMap.containsKey(actId) && fourNodsMap.get(actId).contains(pId);
	}

}
